This section describes the filter function that you can provide to GetSpecificHighLevelEvent . For example, you might use a filter function to search for a high-level event sent from a specific application.
When you use GetSpecificHighLevelEvent (GetSpecificHighLevelEvent) to search the high-level event queue of your application for a specific event, you supply a pointer to a filter function. GetSpecificHighLevelEvent calls your filter function once for each event in the high-level event queue until your filter function returns true or the end of the queue is reached. Your filter function can examine each event and determine whether that event is the desired event. If so, your filter function should return true .
Here's how you declare the filter function MyFilter :
pascal Boolean MyFilter (void *contextPtr,
HighLevelEventMsgPtr msgBuff,
const TargetID *sender);
Your filter function can compare the contents of the contextPtr parameter with the contents of the msgBuff and sender parameters. If your filter function finds a match, it can call AcceptHighLevelEvent , if necessary, and your filter function should return true . If your filter function does not find a match, it should return false .
For information about getting a routine descriptor for your filter function, see "Filter Function Pointer and Macro" .